Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package WinApps (and the Launcher) with Nix #234

Merged
merged 22 commits into from
Nov 1, 2024
Merged

Conversation

oskardotglobal
Copy link
Member

This depends on #232, but this PR makes WinApps and the launcher available to install conveniently using the Nix package manager.

I'll look into getting this into Nixpkgs, the Nix package registry, but this might not be possible since WinApps is technically licensed under ARR.

@LDprg
Copy link
Member

LDprg commented Aug 30, 2024

Great fan of this, since I use nixos myself.

@AkechiShiro
Copy link

Once I do test #232, I can give this a try, thanks a lot for the work @oskardotglobal

@oskardotglobal
Copy link
Member Author

When #15 gets merged, I'll also try to get this into nixpkgs.

@oskardotglobal oskardotglobal force-pushed the feat-nix-packaging branch 3 times, most recently from 5475085 to 073ca6b Compare September 7, 2024 08:49
doc: document installation using Nix

fix: explicitely specify path to inquirer

fix: libvirt group is called libvirtd on nix

fix: set libvirturl for winapps-launcher

fix: refine group change sed expr

feat: add desktop file

fix: do not use source derivation

fix: use install instead of cp

fix: ensure  exists
packages/winapps/default.nix Outdated Show resolved Hide resolved
@AkechiShiro
Copy link

@oskardotglobal can you PR the package upstream on Nixpkgs as a draft PR maybe ? Or if you did test already, PR it for reviews

@oskardotglobal
Copy link
Member Author

Yeah, I will

@oskardotglobal
Copy link
Member Author

It's just currently not building

@oskardotglobal
Copy link
Member Author

Alright, this builds properly again; it would be good if someone were to try this too
I use it on my system but I can't catch all the bugs

@AkechiShiro

This comment was marked as off-topic.

@Alper-Celik

This comment was marked as resolved.

@AkechiShiro

This comment was marked as resolved.

@Alper-Celik

This comment was marked as resolved.

README.md Outdated Show resolved Hide resolved
@oskardotglobal

This comment was marked as resolved.

@Alper-Celik

This comment was marked as resolved.

README.md Show resolved Hide resolved
@scraptux
Copy link

scraptux commented Oct 22, 2024

I think NixOS implementation should include options to enable it as a service. The whole point of NixOS is to configure your system declaratively - adding winapps as is to nixpkgs and then having to run it again to configure it would be against the idea of NixOS.
Especially since stuff like impermanence would make using this package on NixOS harder than just adding .desktop or .rdp files.

For users on nix and not NixOS this, of course, helps already.

@oskardotglobal
Copy link
Member Author

I thought about implementing a service (or more realistically a program) but then ideally it would create the VM too and that was a tad too complicated to me. Feel free to contribute!

@scraptux
Copy link

scraptux commented Oct 22, 2024

I had something similar planned for personal usage. I also believe creating a complete VM and declaratively configuring it (especially windows) is not worth it. I had planned to point the service to an already created vm-image. Creation of this image could be done by a small script. Configuration of the vm could be done via something like AshleyYakeley/NixVirt

I'd gladly try to spin something like this up - however won't be able to until end of next month.

Maybe somebody else has a better idea to integrate into NixOS?

@Alper-Celik
Copy link

I think NixOS implementation should include options to enable it as a service. The whole point of NixOS is to configure your system declaratively - adding winapps as is to nixpkgs and then having to run it again to configure it would be against the idea of NixOS. Especially since stuff like impermanence would make using this package on NixOS harder than just adding .desktop or .rdp files.

For users on nix and not NixOS this, of course, helps already.

this pr doesn't seem to be adding nixos modules.
nixos module could be added but i think it would be better as separate pr

Copy link

@AkechiShiro AkechiShiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the PR is in a good place, there are still improvements points but we need to iterate, if we have more users, we'll get more feedback and we'll be able to polish rough edges.

I haven't found time to test it, I might be able to in a week or so.

I recommend we also note that docker is recommended for now, a workaround for podman was mentioned (RDP does not work) but not tested yet.

For any licensing issues (ARR related), I think we could distribute the package licensed as unfree (if there is any proprietary blobs) if we can separate the proprietary files, we could also bundle them in a standalone package under license.unfree (winapps-proprietary), but even if it's denied upstream at least, we could add hints in the description that the bundle is missing, link towards it, or maybe an attribute (override by user),

{withBundle = true;} # license.unfree;
{WithBundle = false;} # license.agpl3plus;

By default, we'd set withBundle to false.

Thanks a lot for the work done @oskardotglobal and everyone else for the feedback.


meta = with lib; {
homepage = "https://github.com/winapps-org/WinApps-Launcher";
description = "Graphical launcher for WinApps. Run Windows applications (including Microsoft 365 and Adobe Creative Cloud) on GNU/Linux with KDE, GNOME or XFCE, integrated seamlessly as if they were native to the OS. Wayland is currently unsupported.";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested under KDE Plasma 6 Wayland, however it did automatically use xWayland I presume hence worked out of the box, maybe we should try on GNOME Wayland as well and one last that's heavily used, I'm not sure which, Sway may definitely have issues, Hyprland no clue, never used before.

packages/winapps/setup.patch Show resolved Hide resolved
local USER_GROUPS=$(groups "$(whoami)")

- if ! (echo "$USER_GROUPS" | grep -q -E "\blibvirt\b") || ! (echo "$USER_GROUPS" | grep -q -E "\bkvm\b"); then
+ if ! (echo "$USER_GROUPS" | grep -q -E "\blibvirtd\b") || ! (echo "$USER_GROUPS" | grep -q -E "\bkvm\b"); then

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this also could be improved, using an assertion to check if the group exists and if the user evaluating the flake is inside, but I need to check if there are any modules in NixOS doing these kind of assertions or even packages (I haven't seen any AFAIK)

It would fail that way :
trace: <username> not in group kvm and libvirtd, please check <doc-to-declare groups member-groups-wiki>

This addresses the issues in #234 (comment)
and closes #299.
@oskardotglobal
Copy link
Member Author

Since #299 and #300 are resolved now, this is OK to merge

@oskardotglobal
Copy link
Member Author

The proposed NixOS module and getting this into nixpkgs should be discussed in a new discussion created for this purpose.

@oskardotglobal oskardotglobal merged commit e93cf9a into main Nov 1, 2024
3 checks passed
oskardotglobal added a commit that referenced this pull request Dec 13, 2024
This addresses the issues in #234 (comment)
and closes #299.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
8 participants